package org.jeecg.modules.rental.api;

import feign.Param;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.rental.api.fallback.RentalEBikeFallback;
import org.jeecg.modules.rental.entity.IotTerminalTemp;
import org.jeecg.modules.rental.entity.RentalEBike;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "jeecg-rental", fallbackFactory = RentalEBikeFallback.class)
public interface IRentalEBikeAPI {

    //TODO 后续优化从缓存中获取
    @PostMapping("/rental/api/ebike-list")
    Result<List<RentalEBike>> listByQuery(@RequestBody RentalEBike rentalEBike);

    //TODO 后续优化从缓存中获取
    @GetMapping("/rental/api/ebike-get")
    RentalEBike selectCarById(@RequestParam("id") Long id);

    @PostMapping("/rental/api/create") //  新增 createRentalCar 接口
    Result<Boolean> createRentalCar(@RequestBody RentalEBike rentalCar);

    @PostMapping("/rental/api/updateEBikeById") //  新增 updateById 接口
    Result<Boolean> updateById(@RequestBody RentalEBike rentalCar);



    @PostMapping("/equi/terminal/listByQueryWrapper") // New method for selectList
    Result<List<IotTerminalTemp>> listEquTerminals(@RequestBody IotTerminalTemp iotTerminalTemp);


    @PostMapping("/rental/ebike/queryIotById") // New method for selectList
    Result<List<RentalEBike>> listIotcar(@RequestBody RentalEBike rentalEBike);

    @PostMapping("/iot/iotTerminalTemp/queryIotById") // New method for selectList
    Result<List<IotTerminalTemp>> listIot(@RequestBody IotTerminalTemp iotTerminalTemp);


    @PostMapping("/iot/iotTerminalTemp/addIot") //  Method for insert (already mentioned in previous response, but included for completeness)
    Result<String> addTerminal(@RequestBody IotTerminalTemp iotTerminalTemp);

    //TODO 优化从缓存中获取
//    @GetMapping("/rental/rentalCarType/queryById")
//    RentalEBikeType selectCarTypeById(@Param("id") Long id);


    //TODO 优化从缓存中获取
//    @PostMapping("/equi/terminal/listByQueryWrapper") // New method for selectList
//    Result<List<EquTerminal>> listEquTerminals(@RequestBody EquTerminalQueryVo equTerminalQueryVo);
//
//    @PostMapping("/equi/terminal/add") //  Method for insert (already mentioned in previous response, but included for completeness)
//    Result<String> addTerminal(@RequestBody EquTerminal equTerminal);
//
//    @GetMapping("/equi/terminal/queryById") //  新增 queryById 接口 for EquTerminal
//    Result<EquTerminal> queryTerminalById(@RequestParam(name="id", required=true) String id);
}
